//
//  MineCell.swift
//  HR
//
//  Created by zhenyu on 17/6/24.
//  Copyright © 2017年 allblue. All rights reserved.
//

import UIKit

class MineCell: UITableViewCell {
  
  weak var icon: UIImageView!
  weak var title: UILabel!
  
  class func identifier()-> String {
    return "MineCell"
  }
  
  // MARK: - LifeCycle
  override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    selectionStyle = .none
    setViews()
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  override func awakeFromNib() {
    super.awakeFromNib()
    // Initialization code
  }
  
  override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)
    // Configure the view for the selected state
  }
  
  
  // MARK: - SetViews
  func setViews() {
    icon = UIImageView(image: #imageLiteral(resourceName: "m_look")).then({ (i) in
      contentView.addSubview(i)
      i.snp.makeConstraints({ (make) in
        make.centerY.equalTo(contentView)
        make.left.equalTo(25)
      })
    })
    
    title = UILabel().then({ (l) in
      contentView.addSubview(l)
      l.text = "意见反馈"
      l.textColor = Color.font
      l.font = HRFont(size: 15)
    }).then({ (l) in
      l.snp.makeConstraints({ (make) in
        make.left.equalTo(icon.snp.right).offset(14)
        make.centerY.equalTo(icon)
      })
    })
    
    _ = UIImageView(image: #imageLiteral(resourceName: "m_arrow")).then({ (i) in
      contentView.addSubview(i)
      i.snp.makeConstraints({ (make) in
        make.centerY.equalTo(contentView)
        make.right.equalTo(contentView.snp.right).offset(-20)
      })
    })
  }
}
